package com.qf.gh.web.servlet;

import com.alibaba.fastjson.JSON;
import com.qf.gh.domain.GoodsType;
import com.qf.gh.service.GoodsTypeService;
import com.qf.gh.service.impl.GoodsTypeServiceImpl;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet("/goodstypeservlet")
public class GoodsTypeServlet extends BaseServlet{
    public void goodstypelist(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.setCharacterEncoding("utf-8");
        GoodsTypeService goodsTypeService=new GoodsTypeServiceImpl();
        List<GoodsType> list=goodsTypeService.show(1);
        Object json = JSON.toJSON(list);
        response.getWriter().print(json);
    }
}
